package com.workerhelping.feignClients;

import com.workerhelping.elasticsearchEntity.ESAssistVO;
import com.workerhelping.elasticsearchEntity.ESIncomeVO;
import com.workerhelping.elasticsearchEntity.ESRecordVO;
import com.workerhelping.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("ELASTICSEARCH")
public interface ESFeignClient {

    @GetMapping("/ESRecord/findAllByUnreviewed")
    Result<List<ESRecordVO>> findAllByUnreviewed(@RequestParam(value = "sId", required = false) Integer id,
                                                 @RequestParam(value = "sName", required = false) String name,
                                                 @RequestParam(value = "sIdNumber", required = false) String idNumber,
                                                 @RequestParam(value = "sCreditCardNumbers", required = false) String creditCardNumbers);

    @GetMapping("/ESRecord/findAllByApproved")
    Result<List<ESRecordVO>> findAllByApproved(@RequestParam(value = "sId", required = false) Integer id,
                                               @RequestParam(value = "sName", required = false) String name,
                                               @RequestParam(value = "sIdNumber", required = false) String idNumber,
                                               @RequestParam(value = "sCreditCardNumbers", required = false) String creditCardNumbers);

    @GetMapping("/ESRecord/findAllByRejected")
    Result<List<ESRecordVO>> findAllByRejected(@RequestParam(value = "sId", required = false) Integer id,
                                               @RequestParam(value = "sName", required = false) String name,
                                               @RequestParam(value = "sIdNumber", required = false) String idNumber,
                                               @RequestParam(value = "sCreditCardNumbers", required = false) String creditCardNumbers);

    @GetMapping("/ESRecord/findAllByCancelled")
    Result<List<ESRecordVO>> findAllByCancelled(@RequestParam(value = "sId", required = false) Integer id,
                                                @RequestParam(value = "sName", required = false) String name,
                                                @RequestParam(value = "sIdNumber", required = false) String idNumber,
                                                @RequestParam(value = "sCreditCardNumbers", required = false) String creditCardNumbers);

    @GetMapping("/ESIncome/search")
    Result<List<ESIncomeVO>> searchIncome(@RequestParam(value = "sId", required = false) Integer id,
                                          @RequestParam(value = "startDate", required = false) String startDate,
                                          @RequestParam(value = "endDate", required = false) String endDate,
                                          @RequestParam(value = "sYear", required = false) String year,
                                          @RequestParam(value = "minPrice", required = false) Double minPrice,
                                          @RequestParam(value = "maxPrice", required = false) Double maxPrice,
                                          @RequestParam(value = "sCategory", required = false) String category);


    @GetMapping("/ESAssist/search")
    Result<List<ESAssistVO>> searchAssist(@RequestParam(value = "startDate", required = false) String startDate,
                                          @RequestParam(value = "endDate", required = false) String endDate,
                                          @RequestParam(value = "minPrice", required = false) Double minPrice,
                                          @RequestParam(value = "maxPrice", required = false) Double maxPrice,
                                          @RequestParam(value = "sYear",required = false) String year,
                                          @RequestParam(value = "sCategory", required = false) String category,
                                          @RequestParam(value = "workerId", required = false) Integer workerId);
}
